<section class="table-of-content">
	<div class="wrap">
		<div class="inner-box">

			<div class="language-dropdown inverted">
				<div id="dd" class="wrapper-dropdown" tabindex="1">
					<span>Language</span>
					<ul class="dropdown"></ul>
				</div>
			</div>

			<ul id="available-languages" style="display: none;">
				{% if page.languages %}
					<li><a href="{{ site.baseurl }}{{ page.url }}">English</a></li>
					{% for l in page.languages %}
						{% capture intermediate %}{{ page.url }}{% endcapture %}
						{% capture rootTutorialURL %}{{ intermediate | remove_first: '/' }}{% endcapture %}
						{% assign lang = site.data.languages[l] %}
						<li><a href="{{ site.baseurl }}/{{ l }}/{{ rootTutorialURL }}" class="lang">{{ lang.name }}</a></li>
					{% endfor %}
				{% elsif page.language %}
					{% assign engPath = page.url | remove_first: "/" | remove_first: page.language | remove_first: "index.html" %}
					{% assign engPg = site.pages | where: 'partof', page.partof | first %}
					<li><a href="{{ site.baseurl }}{{ engPath }}">English</a></li>
					{% for l in engPg.languages %}
						{% assign lang = site.data.languages[l] %}
						<li><a href="{{ site.baseurl }}/{{ l }}{{ engPath }}" class="lang">{{ lang.name }}</a></li>
					{% endfor %}
				{% endif %}
			</ul>

			<div class="documentation">
				{% for section in page.sections %}
          <div class="section">
            <h2 class="frontpage">{{ section.title }}</h2>
            {% for link in section.links %}
  					<a href="{% if link.link contains '://' %}{{link.link}}{% else %}{{site.baseurl}}{{link.link}}{% endif %}" class="doc-item">
  						<div class="doc-item-header">
  							<i class="{{link.icon}}"></i>
  							<h5>{{link.title}}</h5>
  						</div>
  						<div class="doc-item-main">
  							<p>{{link.description}}</p>
  						</div>
  					</a>
            {% endfor %}
          </div>
          <div class="more-resources">&nbsp;
            {% if section.more-resources %}
              <span class="heading">{{ page.more-resources-label }}: </span>
              <ul>
              {% for resource in section.more-resources %}
                <li><a href="{{ site.baseurl }}{{ resource.url }}">{{ resource.title }}</a></li>
              {% endfor %}
              </ul>
            {% endif %}
          </div>
				{% endfor %}
			</div>
		</div>
	</div>
</section>
